#include"comm.h"


int main()
{
	int msg_id=get_msgid();
	msgvp serve;
	char my_buf[_MAX_BUF_];
	while(1)
	{
		sleep(5);
		msg_receive(msg_id,&serve,sizeof(serve),_CLIENT_ID_);
		printf("client:%s",serve.mmsg_buf);

		printf("please write to client:");
		fflush(stdout);
		int size=read(0,my_buf,_MAX_BUF_);
		if(size>0)
		{
				my_buf[size]='\0';
		}
		msg_send(msg_id,&serve,sizeof(serve),my_buf,_SERVER_ID_);
	}
	
	msg_tory();
	return 0;
}
